package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.JtCommissionDetailMapper;
import com.ruoyi.business.domain.JtCommissionDetail;
import com.ruoyi.business.service.IJtCommissionDetailService;
import com.ruoyi.common.core.text.Convert;

/**
 * 佣金明细Service业务层处理
 * 
 * @author Alan Zhang
 * @date 2025-03-29
 */
@Service
public class JtCommissionDetailServiceImpl implements IJtCommissionDetailService 
{
    @Autowired
    private JtCommissionDetailMapper jtCommissionDetailMapper;

    /**
     * 查询佣金明细
     * 
     * @param detailId 佣金明细主键
     * @return 佣金明细
     */
    @Override
    public JtCommissionDetail selectJtCommissionDetailByDetailId(Long detailId)
    {
        return jtCommissionDetailMapper.selectJtCommissionDetailByDetailId(detailId);
    }

    /**
     * 查询佣金明细列表
     * 
     * @param jtCommissionDetail 佣金明细
     * @return 佣金明细
     */
    @Override
    public List<JtCommissionDetail> selectJtCommissionDetailList(JtCommissionDetail jtCommissionDetail)
    {
        return jtCommissionDetailMapper.selectJtCommissionDetailList(jtCommissionDetail);
    }

    /**
     * 新增佣金明细
     * 
     * @param jtCommissionDetail 佣金明细
     * @return 结果
     */
    @Override
    public int insertJtCommissionDetail(JtCommissionDetail jtCommissionDetail)
    {
        jtCommissionDetail.setCreateTime(DateUtils.getNowDate());
        return jtCommissionDetailMapper.insertJtCommissionDetail(jtCommissionDetail);
    }

    /**
     * 修改佣金明细
     * 
     * @param jtCommissionDetail 佣金明细
     * @return 结果
     */
    @Override
    public int updateJtCommissionDetail(JtCommissionDetail jtCommissionDetail)
    {
        jtCommissionDetail.setUpdateTime(DateUtils.getNowDate());
        return jtCommissionDetailMapper.updateJtCommissionDetail(jtCommissionDetail);
    }

    /**
     * 批量删除佣金明细
     * 
     * @param detailIds 需要删除的佣金明细主键
     * @return 结果
     */
    @Override
    public int deleteJtCommissionDetailByDetailIds(String detailIds)
    {
        return jtCommissionDetailMapper.deleteJtCommissionDetailByDetailIds(Convert.toStrArray(detailIds));
    }

    /**
     * 删除佣金明细信息
     * 
     * @param detailId 佣金明细主键
     * @return 结果
     */
    @Override
    public int deleteJtCommissionDetailByDetailId(Long detailId)
    {
        return jtCommissionDetailMapper.deleteJtCommissionDetailByDetailId(detailId);
    }
}
